package com.searchtree.main;

public class Performance
{
	private int numberOfCompares;
	private int numberOfAssignments;
	private static Performance performance;
	
	public static Performance getInstance()
	{
		if (performance == null)
		{
			performance = new Performance();
		}
		
		return performance;
	}
	
	public Performance()
	{
		numberOfCompares    = 0;
		numberOfAssignments = 0;
	}
	
	public int getNumberOfComparisons()
	{
		return this.numberOfCompares;
	}
	
	public void addToNumberOfCompares(int i)
	{
		this.numberOfCompares += i;
	}
	
	public int getNumberOfAssignments()
	{
		return this.numberOfAssignments;
	}
	
	public void addToNumberOfAssignments(int i)
	{
		this.numberOfAssignments += i;
	}
}
